package banking;

public class Customer {
	private Account account;
	private String firstName;
	private String lastName;
	public Customer(String f,String l) {
	  firstName = f;
	  lastName = l;
	}
	public String getFirstName() {
	  return firstName;
	}
	public String getLastName(){
		return lastName;
	}
	public Account getAccount() {
	  return account;
	}
	public void setAccount (Account acct) {
		account= acct;
	}
	 // 添加 main 方法用于测试 Customer 类
    public static void main(String[] args) {
        Customer customer = new Customer("张", "三");
        System.out.println("创建客户: " + customer.getFirstName() + customer.getLastName());

        Account account = new Account(1000.0);
        customer.setAccount(account);

        System.out.println("初始余额: " + customer.getAccount().getBalance());

        customer.getAccount().deposit(300.0);
        System.out.println("存款 300.0 后余额: " + customer.getAccount().getBalance());

        boolean success = customer.getAccount().withdraw(200.0);
        System.out.println("取款 200.0: " + (success ? "成功" : "失败"));
        System.out.println("最终余额: " + customer.getAccount().getBalance());
    }
}

